<template>
	<Layout>
		<template #title>{{detail.title}}</template>
		<view class="ier-page">
			<view class="iflex fill aic ier-page__time" style="padding-top: 30rpx;">修改时间：{{detail.updateTime??''}}
			</view>
			<view class="iflex fill aic ier-page__time" style="padding-bottom: 30rpx;">生效时间：{{detail.createTime??''}}
			</view>
			<u-parse :html="detail.docContent"></u-parse>
		</view>
		<!-- <LoginPopup @success="loadData"></LoginPopup> -->
	</Layout>
</template>

<script setup lang="ts">
	import { ref } from 'vue';
	import { getDoc } from '@/apis/common';
	import { onLoad } from '@dcloudio/uni-app';

	// 1
	let docType : 1 | 2 | 3 = 1;
	const detail = ref<AnyObject>({
		title: '',
		updateTime: '',
		createTime: '',
		docContent: '',
	});


	function loadData() {
		getDoc(docType).then((result) => {
			detail.value = result.data;
		});
	}

	onLoad((options) => {
		docType = (options as any).docType ?? 1;
		loadData();
	});
</script>
<style lang="scss" scoped>
	.ier-page {
		padding-right: 28rpx;
		padding-left: 28rpx;
		font-size: 28rpx;
		color: #3D3D3D;

		&__time {
			color: #2a2a1e;
			font-size: 28rpx;
			font-weight: 400;
			line-height: normal;
		}
	}
</style>